package com.nuoniu.sibanyun.entity.crm.call.rongying.enumEntity;

public enum FailReason {

    CODE_513("513", "呼叫超时"),
    CODE_514("514", "振铃超时"),
    CODE_515("515", "远端用户主动 Cancel"),
    CODE_516("516", "本端用户主动 Cancel"),
    CODE_518("518", "远端用户呼叫失败"),
    CODE_519("519", "本端用户呼叫失败（OXX"),
    CODE_520("520", "本端用户呼叫失败（18X"),
    CODE_HangUp("HangUp", "正常挂机"),
    CODE_CallerBusy("CallerBusy", "主叫用户忙"),
    CODE_CallerNoAnswer("CallerNoAnswer", "主叫无应答"),
    CODE_CallerFailure("CallerFailure", "主叫其它原因失败"),
    CODE_CallerAbandon("CallerAbandon", "呼叫被叫过程中主叫挂机"),
    CODE_CalleeBusy("CalleeBusy", "被叫忙"),
    CODE_CalleeNoAnswer("CalleeNoAnswer", "被叫无应答"),
    CODE_CalleeFailure("CalleeFailure", "被叫其它原因失败"),
    CODE_Other("Other", "其它原因失败");

    private String code;
    private String msg;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static String getValueByKey(String code) {
        FailReason[] animalEnums = values();
        for (FailReason animal: animalEnums) {
            if (animal.getCode().equals(code)) {
                return animal.getMsg();
            }
        }
        return null;
    }

    FailReason(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
